package com.gistmap.ntdc.util;


import com.gistmap.ntdc.persistence.domain.User;

/**
 * @author zhangran
 * @date 2018/12/20
 */
public class SessionUtil {
    private static ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public static void setUser(User user) {
        userThreadLocal.set(user);
    }

    public static User getUser() {
        return userThreadLocal.get();
    }

    public static void removeUser() {
        userThreadLocal.remove();
    }
}
